#ifndef TASK_DATA_H
#define TASK_DATA_H

#include "main.h"
#include "driver_key.h"
#include "usart.h"
#include "my_task.h"

typedef struct {
	uint8_t sht32_recv[8];
	// 温湿度
	int32_t val_Temp;
	int32_t	val_Hum;
	// 光照强度
#ifdef DEV_LIGHT
	int32_t val_Light;
#endif
	// 二氧化碳
#ifdef DEV_CO2
	uint32_t val_Co2;
#endif
	// 气压
#ifdef DEV_BMP280
	uint32_t val_pressure; // 气压单位 Pa
	uint32_t val_altitude; // 海拔单位 cm
#endif
	// 风速
#ifdef DEV_WIND_SPEED
	uint32_t val_wind_speed;
#endif
	// 风向
#ifdef DEV_WIND_DIRE
	uint32_t val_wind_direction;
#endif
	// 人体传感器
#ifdef DEV_PEOPLE
	uint8_t val_people;
#endif
	// 烟雾报警
#ifdef DEV_SMOCK
	uint8_t val_smoke;
#endif
	// 土壤湿度
#ifdef DEV_SOILHUM
	uint32_t val_soil;
#endif

	// PWM 输出
    uint16_t val_pmw;
	// 灯光状态输出
	uint8_t led_status;
	KEY_PROCESS_TypeDef key_value1;
	KEY_PROCESS_TypeDef key_value2;
	KEY_PROCESS_TypeDef key_value3;
	KEY_PROCESS_TypeDef key_value4;
} SENSOR_CTL;


typedef struct {
	uint8_t work_status; // 工作模式
	uint8_t play_status; // 讲解状态，0 没有讲解 1 对应讲解的话，讲完将状态置为0
	uint8_t wifi_status;
	uint8_t key_up_flag;

	uint8_t message_recv_falg;
	uint8_t message_Buf[Rx_Max];
	uint8_t send_buf[128];
	uint8_t light_run_flag;
	uint8_t soil_run_flag;
	uint8_t main_init_ok;

    uint8_t pid_hot_ctl;
    uint8_t pid_code_ctl;
} SYS_CTL;


#endif

